UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9rrSL9oedSnxQQkgsIISdSsijHvxueOmGT41Qn7GvLA=' 
WHERE 
  key_id = '9b69fd97dafac63823c5d79fc67323aebe0c87a1e6482c8c99356d880a99c954' 
  AND (
    token = '9rrSL9oedSnxQQkgsIISdSsijHvxueOmGT41Qn7GvLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032