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