UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lb/iGoZKQnNaxuAO87esBLFK6nEfRs3WcfSpBNuN8Xo=' 
WHERE 
  key_id = '6557682ec0a227c1349b258af4e3600844dd5e6bc2d37b80fc192c0a6bf37be1' 
  AND (
    token = 'lb/iGoZKQnNaxuAO87esBLFK6nEfRs3WcfSpBNuN8Xo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019