UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XbEFF5FOapBvLvbK+ZlCeEeM1frnG/lk88ZpRqUn5b8='
WHERE
key_id = 'eb1093388c134e40f3e82a4e4a529fbd5b8497c25337226be4ccf52751cbf553'
AND (
token = 'XbEFF5FOapBvLvbK+ZlCeEeM1frnG/lk88ZpRqUn5b8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)