UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Fzg5CkfaYd7NiDWc/S8MtN/KQ9pOJciZLSUvYitYW1c='
WHERE
key_id = 'f00bcae56ae2f9fd8b960533498a17b524aa2d0fdfd239931222c98b5154c356'
AND (
token = 'Fzg5CkfaYd7NiDWc/S8MtN/KQ9pOJciZLSUvYitYW1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)