UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/V6yDNmq36PO+BXg6UpF4AzjZi41YYecEYwsQRDJIvY='
WHERE
key_id = '0eda2c25dcbe243283cd3d19a303e2fe532baa38985696c5d7a372b898847dd1'
AND (
token = '/V6yDNmq36PO+BXg6UpF4AzjZi41YYecEYwsQRDJIvY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)