UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JyatIMEPWofDVD2st1Z+JslQoniSkY+YTDiFgci1Hv8=' 
WHERE 
  key_id = '75297ee14e4388a7a69a320ee0b31bf469f0d27dbd8cae0872b5f784f6e4fe9e' 
  AND (
    token = 'JyatIMEPWofDVD2st1Z+JslQoniSkY+YTDiFgci1Hv8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033