UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O6kZEu/995DtogQhtTofqdL2rJIG8GG9UYANnBd3gEo='
WHERE
key_id = 'fab0cccf4e23d039bace0f3ca9037f470d934c210ae8914a58aded0497f97c97'
AND (
token = 'O6kZEu/995DtogQhtTofqdL2rJIG8GG9UYANnBd3gEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)