UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f2bH+5X+vvwgksPfirZJFB9brvucJ9ql6bXF5Dt2Lkw=' 
WHERE 
  key_id = '5e14a4b8b94b489d1ce8d3d8608f1802b979028b35a7537043b2faf56a42889b' 
  AND (
    token = 'f2bH+5X+vvwgksPfirZJFB9brvucJ9ql6bXF5Dt2Lkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018