UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rP1FbYAdFlRbBTg7k9RFYAMQZIPS/t7yxWixfUBbeFc=' 
WHERE 
  key_id = '262461aa3385e2a67e1622e070930a654090b78b671a891e33cce689141cc6c1' 
  AND (
    token = 'rP1FbYAdFlRbBTg7k9RFYAMQZIPS/t7yxWixfUBbeFc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031