UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'A3GtvSO40TnpE1Zu6DOpj7LYIYJ+3dJhK3dY9HI7BQc='
WHERE
key_id = '8ae18fd8affb60b8899011d8d895b31072abee8cf9c0b31e6d615a4720d97ce4'
AND (
token = 'A3GtvSO40TnpE1Zu6DOpj7LYIYJ+3dJhK3dY9HI7BQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)