UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZjLLCUSpBmd2wXxDknIlr60OJg18AHlqG7rZVrErIpY=' 
WHERE 
  key_id = '2f129fbc15e491e4d283de3a3553b093586b1b26fb983599040bdb7772d7a829' 
  AND (
    token = 'ZjLLCUSpBmd2wXxDknIlr60OJg18AHlqG7rZVrErIpY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021