UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1ROID+VGBykV8SJX3npbt0G7N24Lo/CTH2w2Hs5pDq0=' 
WHERE 
  key_id = 'fee03a88c750e35f7ea47096472193bd9a28351ba11432a9a60dfad1f88f95fa' 
  AND (
    token = '1ROID+VGBykV8SJX3npbt0G7N24Lo/CTH2w2Hs5pDq0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030