UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x5GCsa817WYmZBBuYXh7ORWg/EGwSf72vmB4+TuMCFU=' 
WHERE 
  key_id = '7048855d0060a70fbb3bceef747d71390ced343e1348b36088da0fc1deeb1318' 
  AND (
    token = 'x5GCsa817WYmZBBuYXh7ORWg/EGwSf72vmB4+TuMCFU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017