UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KIVSj/cBm4QVVbINCijMzZn8/Nbj5WMjPkd3H0U1QqI='
WHERE
key_id = 'f4ae9a92834f8feaac75be4d178915c7fea425e7cb309d8eb457a31326a18b2c'
AND (
token = 'KIVSj/cBm4QVVbINCijMzZn8/Nbj5WMjPkd3H0U1QqI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)