UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EPoY9i2djEUjn5nWkrbbOs29O7TrCpjn2xKiQGzEAaA=' 
WHERE 
  key_id = '971d9ef69750278847b85529019bbda1a5133077d9b1626125b7541537fbe02c' 
  AND (
    token = 'EPoY9i2djEUjn5nWkrbbOs29O7TrCpjn2xKiQGzEAaA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035