UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O5qXqBtmzRNgIKD7bYJKJL+1KLDH76fMXMSrOt4s+NI='
WHERE
key_id = '630c614c290b93c78ca63f30a7d8d53261360f356041c9a476017d113b666d6b'
AND (
token = 'O5qXqBtmzRNgIKD7bYJKJL+1KLDH76fMXMSrOt4s+NI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)