UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6+4QK7TQFqKZ239VfsZqJVQXgbB2JDLbXa1Ijc2nGLM='
WHERE
key_id = 'd19d5d00a776d8666a676db7d9d274662b126deea6a9da60be6fc75662b5989f'
AND (
token = '6+4QK7TQFqKZ239VfsZqJVQXgbB2JDLbXa1Ijc2nGLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)