UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R6p55L3PksUHzK5x+EPQ6sR5sTNiXcn3tkGPVpUiq5c=' 
WHERE 
  key_id = '5c209c388a71d69ae43bc08ecd4f5365d3bab98197bc143aa9548982d6e3782e' 
  AND (
    token = 'R6p55L3PksUHzK5x+EPQ6sR5sTNiXcn3tkGPVpUiq5c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061