UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AFrnAmFNO14Fe219wN+EHwjy2JaVjNfSDp8jleCVTNY=' 
WHERE 
  key_id = '7446169c44ab9293ea2784e528bc4ee6de8eb9fc663437015176320c0e37fcb1' 
  AND (
    token = 'AFrnAmFNO14Fe219wN+EHwjy2JaVjNfSDp8jleCVTNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030