UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oZqFX9Ql6S9ZOFegUr+YK+S4rklY/DFozNSQ4fMpseI='
WHERE
key_id = '2180c8565e09f0096ae0dd9241e330f411c6ddb57cab3830e65bea92cc11742c'
AND (
token = 'oZqFX9Ql6S9ZOFegUr+YK+S4rklY/DFozNSQ4fMpseI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)