UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FfvpGGS+8sbh5/Q9q/LYOmtofDKEx4va4T4Bpht+tRc=' 
WHERE 
  key_id = 'b7b79626bcdab56740a86dc92b03525042d31e1b1d0c19bad03a9c4f3c07ed97' 
  AND (
    token = 'FfvpGGS+8sbh5/Q9q/LYOmtofDKEx4va4T4Bpht+tRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036