UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UGqeuM5ju/d8gPhh6KtQxNnHurXWkHrXcof1Z5g/tF4='
WHERE
key_id = 'aeff0e36d37565ef7e6ddbb52fa6eaa09ec712c5af6021772bec0abfe60b35f7'
AND (
token = 'UGqeuM5ju/d8gPhh6KtQxNnHurXWkHrXcof1Z5g/tF4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)