UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4V/MWE/lZ3LbjxNmwJIJdCH3WAhAAW2wJcEa5RmYdvg=' 
WHERE 
  key_id = '024ad94e04a23d864dc645f385e21d2bd3cc4df6b1cd2f0b460325e632fb9be4' 
  AND (
    token = '4V/MWE/lZ3LbjxNmwJIJdCH3WAhAAW2wJcEa5RmYdvg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037