UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'irEMGTYIbLocrxi0lddQfkBnT6nsEpJUMjUs/dmzMAA='
WHERE
key_id = '9e8824e0f9882e3ad0acf4b629d81f7073c7b8d72dea363b8f774828cbd73d42'
AND (
token = 'irEMGTYIbLocrxi0lddQfkBnT6nsEpJUMjUs/dmzMAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)