UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1NO78gG2n17V5zRLq0m6M4yP6+R7RzXkpmQgMwKoKMU=' 
WHERE 
  key_id = '32b2b784c2c20ad9e00693d6e4a725c7301280ee10da334bf0352dedb3422d94' 
  AND (
    token = '1NO78gG2n17V5zRLq0m6M4yP6+R7RzXkpmQgMwKoKMU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030