UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CHlqqFZPJb1kNb1votbxxFpm6oGG/rTKloiQR1gHHCw=' 
WHERE 
  key_id = '0cfa45e4eac46c02f52383f83eb6dfb9999594b6a94f7d06a53d29638f5e8506' 
  AND (
    token = 'CHlqqFZPJb1kNb1votbxxFpm6oGG/rTKloiQR1gHHCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037