UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u4aEGvKK3w8KL33S+yXdCMr275eUQLz8iTwSIsGqyb8=' 
WHERE 
  key_id = '973945cc2b64988f263026e5b19000a962088ed16e9d0e5240874da4cdb261fd' 
  AND (
    token = 'u4aEGvKK3w8KL33S+yXdCMr275eUQLz8iTwSIsGqyb8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036