UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ODKEj0PAmMArgvIoMyrizYEQ9SbFhstKaLj66E8QgiY='
WHERE
key_id = 'fbd5e5598d9917a455baaa2e2defed817c813db8634ae0cf72de4a3ba2742f7f'
AND (
token = 'ODKEj0PAmMArgvIoMyrizYEQ9SbFhstKaLj66E8QgiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)