UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nRjoh5A224loiMuD14QpcwQB+b0I+qZ6a/sYNdnxE+w=' 
WHERE 
  key_id = 'caad2cb013c1ff2b41670444c74a465a84efcfaeb4a9852d76ea0d5d0d43df72' 
  AND (
    token = 'nRjoh5A224loiMuD14QpcwQB+b0I+qZ6a/sYNdnxE+w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033