UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1RXhKWyfJyI8XWVnSyBELRM/dkkXpG5mD+cEPSZKtkw=' 
WHERE 
  key_id = 'b961e694c46dc0a27943e9a80594f89776822671679a3e5f6a6e892023a7653f' 
  AND (
    token = '1RXhKWyfJyI8XWVnSyBELRM/dkkXpG5mD+cEPSZKtkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032