UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qfztZsP/pnYv0f8QWdqWhdJZGO6nMEhpln00x5xyQQY=' 
WHERE 
  key_id = 'd904a3ca1973359c004b24df5177cfb2b673b20ef7e7ed4521f72bbf6cbd75f7' 
  AND (
    token = 'qfztZsP/pnYv0f8QWdqWhdJZGO6nMEhpln00x5xyQQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042