UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AKxBzXLnx9sVaPiZvlYHGtfkNJcEWJYwcizYPPFLJRc=' 
WHERE 
  key_id = '0351af5a0871a474bfe9a907c1cafeb3f5486ace42164005c5d811d509cf0a2b' 
  AND (
    token = 'AKxBzXLnx9sVaPiZvlYHGtfkNJcEWJYwcizYPPFLJRc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059