UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yHLwjOwGzIJRnVSHp9mOzZ3HzJ23tD+UoXuCY5A8ags='
WHERE
key_id = '194f0b123dd2adafba8c32e183c28ef82e9854b27ee311b80fe603850de58db9'
AND (
token = 'yHLwjOwGzIJRnVSHp9mOzZ3HzJ23tD+UoXuCY5A8ags='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)