UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NxC0lY56QG9Pc3eEew0Ryt8cWCeFb5HeA7BeYL/rhFk='
WHERE
key_id = 'eaeb82db92292c967320d4d0b36b3e04472257962cf4f61a46e9899db4a55611'
AND (
token = 'NxC0lY56QG9Pc3eEew0Ryt8cWCeFb5HeA7BeYL/rhFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)